import { Entity } from "../../../../../Core/Module/Entity/Entity";
import { IAwake } from "../../../../../Core/Module/EventSystem/IAwakeSystem";
import { IDestroy } from "../../../../../Core/Module/EventSystem/IDestroySystem";
import { ILoad } from "../../../../../Core/Module/EventSystem/ILoadSystem";
import { List } from "../../../../../Support/Share/Lib/Collections/List";
import { Dictionary } from "../../../../../Support/Share/Lib/Dictionary";
import { ImplementsInterface } from "../../../../../Decorator/Decorator";
import { IMHandler } from "./IMHandler";
import { SceneType } from "../../../../../Core/Module/Entity/SceneType";

export class MessageDispatcherInfo {

    private _SceneType: SceneType;
    public get SceneType(): SceneType {
        return this._SceneType;
    }

    private _IMHandler: IMHandler;
    public get IMHandler(): IMHandler {
        return this._IMHandler;
    }

    constructor(sceneType: SceneType, imHandle: IMHandler) {
        this._SceneType = sceneType;
        this._IMHandler = imHandle;
    }

}

@ImplementsInterface(IAwake)
@ImplementsInterface(IDestroy)
@ImplementsInterface(ILoad)
export class MessageDispatcherComponent extends Entity implements IAwake, IDestroy, ILoad {

    public static Instance: MessageDispatcherComponent;
    public readonly Handlers = new Dictionary<number, List<MessageDispatcherInfo>>();

}